package service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import entity.Survey;
import mapper.SurveyMapper;

@Service
public class SurveyService {
	
	@Resource
	SurveyMapper surveyMapper;

	public SurveyMapper getSurveyMapper() {
		return surveyMapper;
	}

	public void setSurveyMapper(SurveyMapper surveyMapper) {
		this.surveyMapper = surveyMapper;
	}
	
	public List<Survey> findAllSurvey(Survey survey) {
		return surveyMapper.findAllSurvey(survey);
	}
	
	public Survey findSurveyByName(Survey survey) {
		return surveyMapper.findSurveyByName(survey);
	}
	
	public List<Survey> findAllSurveys(){
		return surveyMapper.findAllSurveys();
	}
	
	public boolean newSurvey(Survey survey) {
		boolean end;
		end = surveyMapper.newSurvey(survey);
		return end;
	}
	
	public boolean deleteSurveyById(Survey survey) {
		boolean end = surveyMapper.deleteSurveyById(survey);
		return end;
	}
	
	public Survey findSurveyById(Survey survey) {
		return surveyMapper.findSurveyById(survey);
	}
	
	public boolean updateSurveyBySurveyId(Survey survey) {
		return surveyMapper.updateSurveyBySurveyId(survey);
	}
}
